﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LiteFramework
{
    public struct ReturnValue
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="err">错误消息</param>
        public ReturnValue(string err)
            : this(false, err) 
        { }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="succ"></param>
        /// <param name="err">错误消息</param>
        public ReturnValue(bool succ, string err)
            : this()
        {
            this.Succ = succ;
            this.Err = err;
        }

        /// <summary>
        /// 执行是否成功
        /// </summary>
        public bool Succ { get; set; }
        /// <summary>
        /// 错误信息
        /// </summary>
        public string Err { get; set; }

        public static ReturnValue Ok
        {
            get { return new ReturnValue(true, "ok"); }
        }
    }
}